feat(notification): wire NotificationWithBackoff/RetryUntil to real queue retry - #1528
feat(notification): wire NotificationWithBackoff/RetryUntil to real queue retry#1528codedsultan wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1528 +/- ##
==========================================
+ Coverage 69.80% 69.83% +0.03%
==========================================
Files 409 409
Lines 31388 31428 +40
==========================================
+ Hits 21909 21949 +40
Misses 8445 8445
Partials 1034 1034 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ff25d66 to
a942be4
Compare
…ueue retry
Uses Goravel's documented optional queue.Job interface —
ShouldRetry(err error, attempt int) (retryable bool, delay time.Duration)
confirmed at https://www.goravel.dev/digging-deeper/queues.html#job-retry.
Backoff()/RetryUntil() are evaluated once, eagerly, in
Manager.dispatchQueued — while the live notification still exists — and
carried through the queue boundary as two new dispatchItem fields.
DispatchJob wraps a Deliver() failure in a small deliveryError type so
ShouldRetry (called by the worker with only (err, attempt), no access to
decoded job state) can recover them via errors.As. DispatchJob itself
stays fully stateless — no per-execution fields, since it's registered
once and potentially shared across concurrent worker goroutines.
Without RetryUntil set, NotificationWithBackoff alone would retry
indefinitely, since ShouldRetry had no other bound to check. Adds
DefaultMaxRetryAttempts (exported var, default 10), applied only when
RetryUntil isn't set — RetryUntil already provides its own bound and
takes precedence when both are present.
Known limitation: supports a single fixed backoff per
notification+channel, not a growing per-attempt schedule — there's no
live notification left to call a second time for a bigger number by
retry time.
a942be4 to
dd9df8a
Compare
|
FYI, please add the Ready Review tag once it's ready. |
Ready Review. I cant find the tag is it a slash command ? |
|
the setting icon doesn't appear for me in the label section |
|
The setting icon? Could you paste a screenshot? |
|
PR #1528 wires Laravel resolves backoff the same way ( Suggestion: keep #1528 consistent with #1529 — change |
Ok , i think i should wait for PR #1529 to be merged |
Okay, sorry, I had a mistake. |
|
@codedsultan #1529 has been merged |
|
Given the broadcasting feature implements the Tries and Backoff functions, I think we can implement them in Notification as well. The RetryUntil function can be implemented when it's needed. @codedsultan What do you think about this, please? |
I will get back to you on this. |
…ion-backoff-retry
Notification now uses the same Tries/Backoff design as broadcasting: |


Summary
Wires
NotificationWithBackoff/RetryUntilto real queue retry behavior, using Goravel's documented optionalqueue.Jobinterface:Confirmed against the documented job retry contract: https://www.goravel.dev/digging-deeper/queues.html#job-retry
Design
Backoff()/RetryUntil()are evaluated once, eagerly, inManager.dispatchQueued— while the live notification still exists — and carried through the queue boundary as two newdispatchItemfields.DispatchJobwraps aDeliver()failure in a smalldeliveryErrortype soShouldRetry(called by the worker with only(err, attempt), no access to decoded job state) can recover them viaerrors.As.DispatchJobitself stays fully stateless — no per-execution fields, since it's registered once and potentially shared across concurrent worker goroutines.RetryUntilset,NotificationWithBackoffalone would retry indefinitely. AddsDefaultMaxRetryAttempts(exported var, default 10), applied only whenRetryUntilisn't set —RetryUntilalready provides its own bound and takes precedence when both are present.Known limitation
Supports a single fixed backoff per notification+channel, not a growing per-attempt schedule — there's no live notification left to call a second time for a bigger number by retry time.